const openFullWindowHaveBar = (url) => {
  var redirectUrl = url;
  var width = screen.availWidth - 10;
  var height = screen.availHeight - 50;
  var szFeatures = "top=0,";
  szFeatures += "left=0,";
  szFeatures += "width=" + width + ",";
  szFeatures += "height=" + height + ",";
  szFeatures += "directories=no,";
  szFeatures += "status=yes,toolbar=no,location=no,";
  szFeatures += "menubar=no,";
  szFeatures += "scrollbars=yes,";
  szFeatures += "resizable=yes"; //channelmode
  window.open(redirectUrl, "", szFeatures);
}

//新建流程
function createWorkflow(params) {
  const wfid = params.wfid || '';
  const f_weaver_belongto_userid = params.f_weaver_belongto_userid || '';
  const beagenter = params.beagenter || '';
  const isagent = params.isagent || '';
  //计数
  jQuery.post('/workflow/request/AddWorkflowUseCount.jsp', {
    wfid: wfid
  });
  let paramstr = `workflowid=${wfid}&isagent=${isagent}&beagenter=${beagenter}&f_weaver_belongto_userid=${f_weaver_belongto_userid}&f_weaver_belongto_usertype=0`;
  window.openFullWindowHaveBar('/workflow/request/CreateRequestForward.jsp?' + paramstr);
}

export {
  createWorkflow,
}